/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Persistencia;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 *
 * @author HP
 */
public class SeqHelper {
    
    public static int getId(String nomeTabela){
        int i;
        try {
            ResultSet rs = CRUD.consulta("select seq_"+nomeTabela+".nextval from dual");
            rs.next();
            i = rs.getInt("nextval");                                                
        }catch(SQLException e){
            throw  new RuntimeException(e);
        }                    
        return i;
    }
}
